package com.dhn.newtask;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.dhn.newtask.model.Tweet;
import com.dhn.newtask.util.Request4Tweet;
import com.dhn.newtask.util.RequestManager;

import java.util.ArrayList;

public class TweetActivity extends AppCompatActivity {

    RecyclerView mRecyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tweet);

        mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(TweetActivity.this, LinearLayoutManager.VERTICAL, false));

        Request4Tweet  request4Tweet = new Request4Tweet(Constant.TWEET_URL, new Response.Listener<ArrayList<Tweet>>() {
            @Override
            public void onResponse(ArrayList<Tweet> response) {

            }
        }, new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {

                    }
                });

        RequestManager.newInstance(this).add(request4Tweet);

    }

}
